package mebp.genetic.mutation;

import org.apache.log4j.Logger;

import mebp.genetic.Individuum;
import mebp.genetic.Population;

public class OptimizationMutation implements MutationStrategy {

		Logger log = Logger.getLogger(BreakAndRelinkMutation.class);
		private double probability;
		
		public OptimizationMutation(double probability) {
			this.probability = probability;
		}
		
		public void mutate(Population population) {
			for (Individuum i:population) {
				if (Math.random()<probability) {
					i.optimize(); // has Theta n^2 
								  // always has  better or equal fitness
				}
			}
		}
		

}
